//
//  ZYCAttendanceDetailsMenuView.m
//  ZDSC
//
//  Created by 张威 on 2021/10/26.
//

#import "ZYCAttendanceDetailsMenuView.h"
#import "MenuButton.h"
@interface ZYCAttendanceDetailsMenuView ()

@property (nonatomic, strong) MenuButton *menuButton;
@end
@implementation ZYCAttendanceDetailsMenuView

- (void)setMenuStr:(NSString *)menuStr{
    _menuStr = menuStr;
    [_menuButton setTitle:menuStr forState:UIControlStateNormal];
}


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        [self addSubview:self.menuButton];
        
        [self.menuButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(self);
        }];
    }
    return self;
}
- (MenuButton *)menuButton {
    if (!_menuButton) {
        _menuButton = [MenuButton buttonWithType:UIButtonTypeCustom];
        _menuButton.titleLabel.font = kCustomFont(@"PingFangSC-Regular", 15.0f);;
        [_menuButton setTitleColor:HEX_RGB(@"#2B302D") forState:UIControlStateNormal];
        [_menuButton setImage:[UIImage imageNamed:@"arrow_down"] forState:UIControlStateNormal];
        [_menuButton addTarget:self action:@selector(clickBtnAction:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _menuButton;
}



- (void)clickBtnAction:(UIButton *)sender{
    if ([self.delegate respondsToSelector:@selector(attendanceDetailsMenuViewClickMenu)]) {
        [self.delegate attendanceDetailsMenuViewClickMenu];
    }
}

@end
